#include<bits/stdc++.h>
using namespace std;
long long t,n,p,mid,l,r,ans;
int main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>t;
	while(t--)
	{
		cin>>n;
		if(n==0)
		{
			cout<<2<<'\n';
			continue;
		}
		l=3,r=1e18;
		while(l<=r)
		{
			mid=(l+r)/2;
			if(mid%2==1)
			{
				if((__int128)(mid-1)*(mid/2)/2>=n)
					r=mid-1,ans=mid;
				else
					l=mid+1;
			}
			else{
				if((__int128)(mid-2)*(mid/2)/2>=n)
					r=mid-1,ans=mid;
				else
					l=mid+1;
			}
		}
		if(ans%2==1)
			p=(ans-1)*(ans/2)/2;
		else
			p=(ans-2)*(ans/2)/2;
//		cout<<p<<" "<<n<<" "<<ans<<" ";
		if(ans%2==1)
			cout<<ans<<'\n';
		else
		{
			if((p-n)%2==0)
				cout<<ans<<'\n';
			else 
				cout<<ans+1<<'\n';
		}
	}
	return 0;
 } 
